package supermarket.dao.impl;

import java.util.List;

import supermarket.dao.CustomerCatalog;
import supermarket.dao.ProductCatalog;
import supermarket.dao.Shop;
import supermarket.model.Customer;
import supermarket.model.Product;

public class ShopImpl implements Shop {

	private CustomerCatalog customerCatalog;
	private ProductCatalog productCatalog;
	
	public void setCustomerCatalog(CustomerCatalog customerCatalog) {
		this.customerCatalog = customerCatalog;
	}
	
	public void setProductCatalog(ProductCatalog productCatalog) {
		this.productCatalog = productCatalog;
	}
	
	@Override
	public Customer getCustomer(Integer id) {
		return this.customerCatalog.getCustomer(id);
	}
	
	@Override
	public List getCustomerByName(String name) {
		return (List)this.customerCatalog.getCustomerByName(name);
	}
	
	@Override
	public List getCustomerList() {
		return this.customerCatalog.getCustomerList();
	}
	
	@Override
	public void addCustomer(Customer customer) {
		this.customerCatalog.addCustomer(customer);
	}
	
	@Override
	public void addCustomerByName(String name) {
		this.customerCatalog.addCustomerByName(name);
		
	}
	
	@Override
	public void updateCustomer(Customer customer) {
		this.customerCatalog.updateCustomer(customer);
		
	}
	
	@Override
	public void removeCustomer(Customer customer) {
		this.customerCatalog.removeCustomer(customer);
	}
	
	@Override
	public Product getProduct(Integer id) {
		return this.productCatalog.getProduct(id);
	}
	
	@Override
	public List getProductByName(String name) {
		return this.productCatalog.getProductByName(name);
	}
	
	@Override
	public List getProductByCategory(String category) {
		return this.productCatalog.getProductByCategory(category);
	}
	
	@Override
	public List getProductList() {
		return this.productCatalog.getProductList();
	}
	
	@Override
	public void addProduct(Product product) {
		this.productCatalog.addProduct(product);
	}
	
	@Override
	public void addProductByName(String name) {
		this.productCatalog.addProductByName(name);
	}
	
	@Override
	public void updateProduct(Product product) {
		this.productCatalog.updateProduct(product);
	}
	
	@Override
	public void removeProduct(Product product) {
		this.productCatalog.removeProduct(product);
	}

}
